// D3D9IndexBuffer.h

#ifndef __D3D9INDEXBUFFER_H__
#define __D3D9INDEXBUFFER_H__

class CD3D9IndexBuffer
{
private:
	IDirect3DIndexBuffer9* m_pIndexBuffer;
public:
	CD3D9IndexBuffer(D3DFORMAT indexType, size_t numIndices, DWORD dwUsage, LPDIRECT3DDEVICE9 pDev);
	~CD3D9IndexBuffer();

	// non-const method
	void write(size_t offset, size_t length, const void *pSource, bool bDiscardWholeBuffer);

	// const method
	IDirect3DIndexBuffer9* GetBuffer(void) const;
};

#endif